{% extends "mybase.html"  %}
{% block content -%}
<div class="row clearfix">
    <div class="col-md-4 col-md-offset-4 column">
        <h2 align="center">更改计划</h2>
        <form class="form-group" action="/todolist/edit/{{result.id}}" method="post">
            <div class="form-group">
                <label for=""><span style="color: red">*</span>计划名称</label>
                <input required class="form-control" name='task' type="text" value="{{result.task}}">
            </div>
            <div class="form-group">
                <label for=""><span style="color: red">*</span>详情</label>
                <input required class="form-control" name='description' type="text" value="{{result.description}}">
            </div>
            <div class="form-group">
                <label for="">类别</label>
                <input required class="form-control" name='category' type="text" value="{{result.category}}">
            </div>
            <div class="form-group">
                <label for=""><span style="color: red">*</span>到期时间</label>
                <input required class="form-control" name='expire_time' id='datetimepicker' type="text" value="{{result.expire_time.strftime('%Y-%m-%d') }}">
            </div>
            <div class="form-group">
                <label for="">状态</label>
                <!-- <input class="form-control" name='complete' type="text" value="{{result.complete}}"> -->
                <select class="form-control" name='complete'>
                    {% if result.complete %}
                        <option selected="selected" value="1">完成</option>
                        <option value="0">未完成</option>
                    {% else %}
                        <option value="1">完成</option>
                        <option selected="selected" value="0">未完成</option>
                    {% endif %}
                </select>
            </div>
            <div class="text-right">
                <button class="btn btn-primary" type="submit">提交</button>
            </div>
        </form>
    </div>
</div>
{%- endblock content %}
    {% block myscripts %}
    <script type="text/javascript">
        $(document).ready(function () {
            $('#datetimepicker').datepicker({
                format: 'yyyy-mm-dd',
                startDate: '0d'
            });
        });
    </script>
    {% endblock myscripts %}